const { http } = uni.$u;

export const fetchSettingProfile = (params, config) => {
  return http.post("/crm/customer/settingProfile", params, {
    ...config,
    custom: {
      needToken: true,
    },
  });
};

// 获取客户信息
export const fetchCustomerAccount = (params, config) => {
  return http.post("/crm/account/getCategoryAccounts", params, {
    ...config,
    custom: {
      needToken: true,
    },
  });
};

//商家信息
export const fetchMerchantInfo = (params) => {
  return http.post("/crm/merchant/getDetail", params);
};

//获取客户信息
export const fetchCustomerInfo = (params) => {
  return http.post("/crm/customer/getDetail", params);
};

/**
 * 申请成为代理商 (团长)
 */
export const fetchSysAgentOpenSysAgent = (params, config) => {
  return http.post("/crm/sysAgent/openSysAgent", params, {
    ...config,
    custom: {
      needToken: true,
    },
  });
};

/**
 * 获取客户积分信息
 */
export const fetchCustomerWalletInfo = (params, config) => {
  return http.post("/crm/customer/getWalletInfo", params, {
    ...config,
    custom: {
      needToken: true,
    },
  });
};
